import GView, { setupStore, i18n, useI18n } from "@gonsin/gview";

import { createApp, markRaw } from "vue";
import { createPinia } from "pinia";

import App from "./App.vue";
import router from "./router";

import TDesign from "tdesign-vue-next";

const app = createApp(App);
const { setupI18n, T } = useI18n({
	project: "venus",
});
app.use(i18n);
setupI18n();
app.config.globalProperties.T = T;

const pinia = createPinia();
app.use(pinia);
pinia.use(({ store }) => {
	store.router = markRaw(router);
});
setupStore(pinia);

app.use(GView, { router });
app.use(TDesign);
app.use(router);

app.mount("#app");
